<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>大连高校环境联盟</title>
    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap-dialog.min.css">
    <link rel="stylesheet" type="text/css" href="css/mricode.pagination.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/user.css">

    <!-- Javascript -->
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="js/jquery.cookie.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/bootstrap-dialog.min.js"></script>
    <script type="text/javascript" src="js/mricode.pagination.js"></script>
    <script type="text/javascript" src="ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" src="ueditor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" src="ueditor/ueditor.parse.js"></script>
    <script type="text/javascript" src="js/utils.js"></script>
     <script type="text/javascript" src="js/sign-up-in.js"></script>
    <script type="text/javascript" src="js/manager.js"></script>
</head>

<body>
    <div>
        <div style="background-color: #036eb8; height: 3px"></div>
        <div style="background-image: url('images/bg1.gif'); height: 120px;">
            <div class="container">
                <div class="pull-right" style="margin-top: 10px;">
                    <a href="#" style="font-size: 13px;" id="exit">注销</a>
                </div>
                <div class="pull-right" style="margin-top: 10px; margin-right: 10px">
                    <a href="#" style="font-size: 13px;" id="seeHello"></a>
                </div>
                <div class="container" style="padding-top: 15px">
                    <img src="images/logo_title.png" alt="logo">
                </div>
            </div>
        </div>
        <div class="container">
            <div class="row clearfix">
                <div class="col-md-12">
                    <nav class="navbar navbar-default no-radius" role="navigation">
                        <div class="collapse navbar-collapse">
                            <ul class="nav navbar-nav" id="nav">
                                <li  id="test_home" class="guest">
                                    <a href="home.html">首页</a>
                                </li>
                                <li class="dropdown guest">
                                    <a href="introduction.html?page=0" class="dropdown-toggle" data-toggle="dropdown">了解我们</a>
                                    <ul class="dropdown-menu">
                                        <li><a href="introduction.html?page=0">槐盟介绍</a></li>
                                        <li><a href="introduction.html?page=1">联系我们</a></li>
                                        <li><a href="introduction.html?page=2">活动图片</a></li>
                                    </ul>
                                </li>
                                <li class="dropdown guest">
                                    <a href="activity.html" class="dropdown-toggle" data-toggle="dropdown">活动</a>
                                    <ul class="dropdown-menu">
                                        <li><a href="activity.html">活动预告</a></li>
                                        <li><a href="index.html?menu=activity&type=PRESENTATION">活动展示</a></li>
                                        <li><a href="index.html?menu=activity&type=ACTIVITY">相关新闻</a></li>
                                    </ul>
                                </li>
                                <li class="dropdown guest">
                                    <a href="index.html?menu=knowledge&type=PROJECT" class="dropdown-toggle" data-toggle="dropdown">科普知识</a>
                                    <ul class="dropdown-menu">
                                        <li><a href="index.html?menu=knowledge&type=PROJECT">项目知识</a></li>
                                        <li><a href="index.html?menu=knowledge&type=WELFARE">公益知识</a></li>
                                    </ul>
                                </li>
                                <li class="dropdown user">
                                    <a href="index.html?menu=private_activity&type=OFFICE" class="dropdown-toggle" data-toggle="dropdown" id="hh">内部活动</a>
                                    <ul class="dropdown-menu">
                                        <li><a href="index.html?menu=private_activity&type=OFFICE">办公室</a></li>
                                        <li><a href="index.html?menu=private_activity&type=RELATIONS">外联部</a></li>
                                        <li><a href="index.html?menu=private_activity&type=PUBLICITY">宣传部</a></li>
                                        <li><a href="index.html?menu=private_activity&type=FINANCIAL">财务部</a></li>
                                        <li><a href="index.html?menu=private_activity&type=PROJECT">项目部</a></li>
                                    </ul>
                                </li>
                                <li class="dropdown user">
                                    <a href="index.html?menu=training&type=OFFICE" class="dropdown-toggle" data-toggle="dropdown">培训</a>
                                    <ul class="dropdown-menu">
                                        <li><a href="index.html?menu=training&type=OFFICE">办公室</a> </li>
                                        <li><a href="index.html?menu=training&type=RELATIONS">外联部</a> </li>
                                        <li><a href="index.html?menu=training&type=PUBLICITY">宣传部</a> </li>
                                        <li><a href="index.html?menu=training&type=FINANCIAL">财务部</a> </li>
                                        <li><a href="index.html?menu=training&type=PROJECT">项目部</a> </li>
                                    </ul>
                                </li>
                                <li class="dropdown user">
                                    <a href="index.html?menu=notice&type=PROJECT" class="dropdown-toggle" data-toggle="dropdown">公示</a>
                                    <ul class="dropdown-menu">
                                        <li><a href="index.html?menu=notice&type=PROJECT">项目一览</a></li>
                                        <li><a href="index.html?menu=notice&type=HM">槐盟公示</a></li>
                                    </ul>
                                </li>
                                <li class="dropdown user">
                                    <a href="individual.html" class="dropdown-toggle" data-toggle="dropdown">个人中心</a>
                                    <!--<ul class="dropdown-menu">-->
                                        <!--<li><a href="#" onclick="showDiv(0)">个人信息</a></li>-->
                                        <!--<li><a href="#" onclick="showDiv(1)">信息修改</a></li>-->
                                    <!--</ul>-->
                                </li>
                                <li class="dropdown manager">
                                    <a href="manager.html" class="dropdown-toggle" data-toggle="dropdown">用户管理</a>
                                </li>
                            </ul>
                            <form class="navbar-form navbar-right" role="search" style="width:20%;display:none;">
                                <div class="form-group input-group">
                                    <input type="text" class="form-control no-radius" />
                                    <div class="input-group-btn">
                                        <button type="submit" class="btn btn-default no-radius">
                                            <span class="glyphicon glyphicon-search"></span>
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </nav>
                </div>
            </div>
            <div class="row clearfix">
                <div class="col-md-3">
                    <div class="panel panel-primary no-radius">
                        <div class="panel-heading no-radius">
                            <h3 class="panel-title">用户管理</h3>
                        </div>
                        <ul class="list-group no-radius">
                            <li class="list-group-item no-radius" id="user" onclick="show_user()" style="cursor: pointer"><a href="#">普通用户</a></li>
                            <li class="list-group-item no-radius" id="vip" onclick="show_user()" style="cursor: pointer"><a href="#">高级用户</a></li>
                            <li class="list-group-item no-radius" id="changeInvite" onclick="show_inv()" style="cursor: pointer"><a href="#">邀请码</a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-md-9">
                    <div id="conV1" style="display:block;">
                    <div>
                        <button type="button" class="btn btn-danger no-radius" id="delete-button">删除</button>
                        <button type="button" class="btn btn-success no-radius" id="modify-button">升级为高级用户</button>
                        <form class="navbar-form navbar-right" role="search">
                            <div class="form-group input-group" style="display:none;">
                                <input type="text" class="form-control no-radius">
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-default no-radius">
                                        <span class="glyphicon glyphicon-search"></span>
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div>
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>自然名</th>
                                    <th>级别</th>
                                    <th>邮箱</th>
                                </tr>
                            </thead>
                            <tbody id="contentTable">
                            </tbody>
                            <!--<tbody>
                                <tr id="item0">
                                    <td>
                                        <input type="checkbox" name="checkbox" id="check">
                                    </td>
                                    <td>Tanmay</td>
                                    <td>Bangalore</td>
                                    
                                    <td>560001@gmail.com</td>
                                </tr>
                            
                            </tbody> -->
                        </table>
                    </div>
                    <div id="contentPage" class="m-pagination"></div>
                    </div>
                    <div id="conV2" style="display: none">
                        <div class="content">
                            <div>
                                <p>用户管理 - 邀请码</p>
                                <hr>
                            </div>
                            <form class="form-horizontal" role="form" style="min-height:450px;font-family: 微软雅黑" id="message">
                                <div class="form-group">
                                    <label for="tinvite" class="control-label col-xs-3">邀请码(当前)</label>
                                    <label id="tinvite" class="label_show" style="margin-bottom: 0;padding-top: 7px;padding-left: 15px"></label>
                                </div>
                                <div class="form-group">
                                    <label for="odeadline" class="control-label col-xs-3">截止日期</label>
                                    <label id="odeadline" class="label_show" style="margin-bottom: 0;padding-top:7px;padding-left: 15px"></label>
                                </div>
                                <div class="form-group">
                                    <label for="ninvite" class="control-label col-xs-3">新邀请码</label>
                                    <div class="col-xs-5">
                                        <input type="text" class="form-control " id="ninvite" required="required" placeholder="请输入新邀请码">
                                        <div class="check-result"></div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-xs-3">截止日期</label>
                                    <div class="col-xs-5">
                                        <input type="date" class="form-control" id="ndeadline" required="required">
                                    </div>
                                </div>
                                <div>
                                    <button type="button" class="btn btn-primary" style="margin-left:40%;border-radius: 4px;width:8%;" id="ok" onclick="checkdeadline()">确定</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="footer">
                    <div class="item">
                        <a href="introduction.html?page=0" style="margin-right: 5px;">关于我们</a>
                        <a href="introduction.html?page=1" style="margin-left: 5px;">联系我们</a>
                    </div>
                    <div class="item">
                        <label style="color:#8a8a8a;font-weight: normal">&copy 版权所有 大连理工大学红蚂蚁实验室</label>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="js/user.js"></script>
    <script>
            function checkdeadline() {
                var invite=$("#ninvite").val();
                var deadline=$('#ndeadline').val();
                var second=new Date($('#ndeadline').val()).getTime();
                //获取系统时间
                var initializationTime=(new Date()).getTime();
                if(invite=="")
                {
                    alertWarning("邀请码不可为空");
                    return false;
                }
                if(deadline=="")
                {
                    alertWarning("日期不可为空");
                    return false;
                }
                if(initializationTime>second)
                {
                    alertWarning("请输入合法日期");
                    return false;
                }
                $.ajax({
                    url:'/user/manage/invitation-code/set',
                    type: "post",
                    data:{
                        value:invite,
                        expirationTime:second
                    }
                })
                    .fail(function (jqXHR, textStatus) {
                        alertWarning('提交失败!');
                    })
                    .done(function (data) {
                       alertInfo('修改成功');
                       $('#tinvite').html(invite);
                       $('#odeadline').html(deadline);
                       $('#ndeadline').val("");
                       $('#ninvite').val("");
                    })
            }

            function show_inv() {
                $("#conV1").css("display","none");
                $("#conV2").css("display","block");
            }

            function show_user() {
                $("#conV2").css("display","none");
                $("#conV1").css("display","block");
            }
    </script>
    <script type="text/javascript" src="js/invite.js"></script>
</body>
</html>
